<template>
  <div class="box">

  </div>
</template>

<script setup lang="ts">
import {getCurrentInstance, inject, onMounted, reactive, ref, watch, defineAsyncComponent} from "vue";
import {showToast} from "vant";

import Test3 from "@/view/moban.vue";

let test2 = ref(Test3)
// const Test1 = defineAsyncComponent({
//   loader:()=>import('@/view/moban.vue'),
//   delay:10000
// })

const {proxy} = getCurrentInstance() as any; // 类似于this
// 使用pinia
import {UseInfoStore, StaticStore} from '@/store/index.ts'
import {storeToRefs} from "pinia";
import {User} from "@/interface";
//直接获取数据
const userInfo = UseInfoStore()
const staticStore = StaticStore()
//解构 需要的数据
const {info} = storeToRefs(userInfo)
const {company} = storeToRefs(staticStore)
//测试
let UInfo: User = {
  username: '',
  password: '',
  test: ''
}

onMounted(() => {
  //测试
  console.log(info.value, company.value)
  console.log(userInfo.info, 'userInfo')
  console.log(UInfo, 'UInfo')
})

// /**
//  * 模式 测试
//  */
let test = async()=>{
  let res = await proxy.$API.User.test({
    type:1,
    username:'Ethan',
    password:'Ethan@123'
  })
  console.log(res)
  localStorage.setItem('token',res.token)
}
let test22 = async()=>{
  let res = await proxy.$API.User.test2({
  })
  console.log(res)
}
//跳转专用
onMounted(() => {
  if (proxy.$route.query.invitationCode) {
  }
  if (proxy.$route.query.sendSuccess) {
  }
  console.log('测试',proxy.$tool.isWX())
})

</script>

<style scoped lang="scss">
.box {
  font-size: 22px;
  min-width: 1149px;
  width: 100vw;
  height: 100vh;
  background-color: white;
  .head{
    width: 1200px;
    height: 59px;
    background: white;
  }
}
</style>